import service from './service';

let base = 'v1';


export const addUser = params => { return service.$post(`${ base }/user/add`, params); };

export const editUser = params => { return service.$post(`${ base }/user/edit`, params); };

export const removeUser = params => { return service.$post(`${ base }/user/remove`, params); };

export const postError = params => { return service.$get(`${ base }/error`, {params: params}); };

export const fetchSchoolList = params => {return service.$get(`${ base }/schools`); };

export const fetchWorkDurationOptions = params => {return service.$get(`${ base }/work_durations`); };

export const fetchAcademicOptions = params => {return service.$get(`${ base }/academics`); };

export const postResume = params => {return service.$post(`${ base }/resume`, params);};

export const createResume = params => { return service.$post(`${ base }/resume/add`); };

// api

export const getDict = params => { return service.$get(`${ base }/dictionary/getListByType/0/${params.type}`,{}); }

export const requestLogin = params => { return service.$post(`${ base }/login`, params); };

export const getShopList = params => { return service.$post(`${ base }/shop/queryList`,params) };

export const getShopQueryAll = params => { return service.$get(`${ base }/shop/queryAll`, params) };

export const getShopDetail = id => { return service.$get(`${ base }/shop/${ id }`,{}) };

export const addShop = params => { return service.$post(`${ base }/shop`,params) };

export const deleteShop = id => { return service.$delete(`${ base }/shop/${ id }`,{}) };

export const getProductList = params => { return service.$post(`${ base }/product/queryList`,params) };

export const getProductDetail = id => { return service.$get(`${ base }/product/${ id }`, {}) };

export const addProduct = params => { return service.$post(`${ base }/product`,params) };

export const deleteProduct = id => { return service.$delete(`${ base }/product/${ id }`,{}) };

export const getBannerList = params => { return service.$post(`${ base }/banner/queryListPage`,params) };

export const getBannerDetail = id => { return service.$get(`${ base }/banner/${id}`,{}) };

export const addBanner = params => { return service.$post(`${ base }/banner`,params) };

export const deleteBanner = id => { return service.$delete(`${ base }/banner/${id}`,{}) }

export const getScenicList = params => { return service.$post(`${ base }/scenic/queryListPage`,params) };

export const getScenicDetail = id => { return service.$get(`${ base }/scenic/${id}`,{}) };

export const addScenic = params => { return service.$post(`${ base }/scenic`,params) };

export const deleteScenic = id => { return service.$delete(`${ base }/scenic/${id}`,{}) };

export const downloadQrcode = params => { return service.$post(`${ base }/wechatCode/qrCode`, params) };

export const getUserIndentList = params => { return service.$post(`${ base }/userIndent/queryList`,params) };

export const getUserIndentDetail = id => { return service.$get(`${ base }/userIndent/${id}`,{}) };

export const updateUserIndent = params => { return service.$post(`${ base }/userIndent`,params) };